const Controller = require('egg').Controller;

class UserController extends Controller {
    async login() {
        const { ctx } = this
        try {
            let { password, phone } = ctx.request.body;
            console.log(password,phone)
            const result = await ctx.service.user.login(password, phone)
            ctx.response.body = result
        } catch (e) {
            ctx.response.body = {
                code: 0,
                msg: e.message
            }
        }
    }
}

module.exports = UserController;
